//
//  BaseTabBarButton.m
//  Cycling
//
//  Created by cjg.mini on 2023/3/2.
//

#import "BaseTabBarButton.h"
#import "Public.h"

@implementation BaseTabBarButton

- (void)layoutSubviews
{    [super layoutSubviews];
    
    CGRect imageRect = self.imageView.frame;
    CGRect titleRect = self.titleLabel.frame;
    imageRect.size = self.imageSize;
    titleRect.size = CGSizeMake(60, 15);
    imageRect.origin.x = (self.frame.size.width - imageRect.size.width)/2.0f;
    imageRect.origin.y = 5;
    titleRect.origin.x = 0;
    titleRect.origin.y = imageRect.origin.y + imageRect.size.height +5;
    self.imageView.frame = imageRect;
    UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(self.imageView.ce_x + imageRect.size.width + 4, self.imageView.ce_y, 4, 4)];
    redView.backgroundColor = UIColor.redColor;
    redView.layer.cornerRadius = 2;
    redView.layer.masksToBounds = YES;
    redView.hidden = YES;
    [self addSubview:redView];
    self.redView = redView;
    self.titleLabel.frame = titleRect;
    self.titleLabel.font = Font(14);
    self.titleLabel.textAlignment = 1;

}



@end
